﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace CodeStash.Models.Settings
{
    public class HighlightingCSS
    {
        public int Id { get; set; }
        public string CSSName { get; set; }

        public HighlightingCSS(int id, string cssName)
        {
            this.Id = id;
            this.CSSName = cssName;
        }
    }


    public class ChangeSettingsModel
    {
        #region Ctor
        /// <summary>
        /// For Post request where ModelBinding takes care of matching up properties for us
        /// </summary>
        public ChangeSettingsModel()
        {
            HighlightingCSSList = CompleteHighlightingCSSList.Value;
        }
        #endregion

        #region Public Properties

        public List<HighlightingCSS> HighlightingCSSList { get; set; }

        [Required(ErrorMessage = "You must enter a value for Highlighting CSS")]
        public int HighlightingCSS { get; set; }

        [Range(5,100,ErrorMessage = "Maximum Snippets To Display must be between 5-100")]
        public int MaxSnippetsToDisplay { get; set; }


        public static Lazy<List<HighlightingCSS>> CompleteHighlightingCSSList = new Lazy<List<HighlightingCSS>>(() =>
        {
            List<HighlightingCSS> list = new List<HighlightingCSS>();
            list.Add(new HighlightingCSS(1,"acid"));
            list.Add(new HighlightingCSS(2,"berries-dark"));
            list.Add(new HighlightingCSS(3,"berries-light"));
            list.Add(new HighlightingCSS(4,"bipolar"));
            list.Add(new HighlightingCSS(5,"blacknblue"));
            list.Add(new HighlightingCSS(6,"bright"));
            list.Add(new HighlightingCSS(7,"darkblue")); 
            list.Add(new HighlightingCSS(8, "darkness")); 
            list.Add(new HighlightingCSS(9,"dull"));
            list.Add(new HighlightingCSS(10,"emacs"));
            list.Add(new HighlightingCSS(11, "golden")); 
            list.Add(new HighlightingCSS(12,"ide-anjuta"));
            list.Add(new HighlightingCSS(13,"ide-codewarrior"));
            list.Add(new HighlightingCSS(14,"ide-devcpp"));
            list.Add(new HighlightingCSS(15,"ide-eclipse"));
            list.Add(new HighlightingCSS(16,"ide-kdev"));
            list.Add(new HighlightingCSS(17,"ide-msvcpp"));
            list.Add(new HighlightingCSS(18,"kwrite"));
            list.Add(new HighlightingCSS(19,"matlab"));
            list.Add(new HighlightingCSS(20,"navy"));
            list.Add(new HighlightingCSS(21,"nedit"));
            list.Add(new HighlightingCSS(22, "neon"));  
            list.Add(new HighlightingCSS(23, "pablo"));  
            list.Add(new HighlightingCSS(24,"print"));
            list.Add(new HighlightingCSS(25,"rand01"));
            list.Add(new HighlightingCSS(26,"the"));
            list.Add(new HighlightingCSS(27,"typical"));
            list.Add(new HighlightingCSS(28,"vampire"));
            list.Add(new HighlightingCSS(29,"vim"));
            list.Add(new HighlightingCSS(30,"vim-dark"));
            list.Add(new HighlightingCSS(31,"whatis"));
            list.Add(new HighlightingCSS(32,"whitengrey"));
            list.Add(new HighlightingCSS(33, "zellner"));

            return list;
        });
        #endregion
    }

}